Skip to content

Submissions: shared client+server validation + brand-voice states#10

Open
VisionaireLabs wants to merge 1 commit into
masterfrom
fix/submission-validation
Open

Submissions: shared client+server validation + brand-voice states#10
VisionaireLabs wants to merge 1 commit into
masterfrom
fix/submission-validation

Conversation

@VisionaireLabs

Copy link
Copy Markdown
Collaborator

Closes SOL-6.

What

Adds matched client- and server-side validation to the skill submission flow, with success/error states in the Solid State voice.

  • lib/submission.ts — single source of truth for validation, imported by both the form and the API route so the rules can't drift. Checks email/URL shape, version format, field lengths (short_description capped at 120 to match the DB constraint), category/platform membership, and free-vs-paid price rules ($1–$999, required when paid, forbidden when free).
  • Client (SubmitForm.tsx) — runs the same validator before the POST for instant feedback, renders inline per-field errors, and hydrates field errors the server returns.
  • Server (/api/submit) — validates authoritatively (never trusts the client), returns field-keyed errors, and no longer leaks raw Supabase error strings to the browser.
  • Error/success copy rewritten in brand voice (terse, direct).

Pipeline verification

  • tsc --noEmit and eslint both pass on the changed files.
  • Insert row shape verified field-for-field against migration 0001 (submissions table) and the "Anyone can submit" RLS insert policy — the route writes exactly the insertable columns, status defaults to pending.
  • Note: a live write against the real Supabase project needs NEXT_PUBLIC_SUPABASE_* (and RESEND_API_KEY for the email) which aren't available in the agent sandbox; the pipeline is verified by schema/contract review, not a live insert.

🤖 Generated with Claude Code

Add lib/submission.ts as the single source of truth for submission
validation, imported by both the submit form and the /api/submit route
so rules can't drift. Validates email/URL shape, version, lengths,
platform/category membership, and free-vs-paid price rules.

- Client: runs the same validator before POST, shows inline per-field
  errors and hydrates field errors returned by the server.
- Server: validates authoritatively, returns field-keyed errors, and
  stops leaking raw DB error messages to clients.
- Error/success copy rewritten in the Solid State voice.

Insert row shape verified against migration 0001 (submissions) columns
and the "Anyone can submit" RLS insert policy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
solidstate.cc Error Error Jun 3, 2026 10:27pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant